import React, { Component } from 'react';
// 引入eventBus 中央事件总线
import eventBus from '../../utils/events'
class Child2 extends Component {
    state = {
        skill: ''
    }
    render() {
        return (
            <div>
                <p>我是二娃--{this.state.skill}</p>
            </div>
        );
    };
    componentDidMount() {
        eventBus.on('transfer', (data) => {
            console.log('data', data);
            this.setState({
                skill: data
            })
        })
    }
}

export default Child2;
